function HunterG1zStar1() -- BM

	if not ThrottleFrame then _ThrottleFrame() end
	if not gpthrottle then gpthrottle = 0 end

	if ccrValidTarget() and ccrPIIC() then

		if not Pet then
			if GetTime() > gpthrottle + 1.5 then
				print("Summon a Pet")
				gpthrottle = GetTime()
				return
			end
		elseif UnitIsDead("pet") then
			ccrCast(982)
			return
		end

		if ccRS.G1zStarInterrupt then InterruptTrainer() end

		if not _G[UnitGUID("target").."_tSerpentSting"] then _G[UnitGUID("target").."_tSerpentSting"] = 0 end

		if isStun and SCA("Intimidation") then
			ccrCastAttack("Intimidation")
			isStun = false
			PrintToChat("Turned off stun automatically")
		end
		-- if GTargetCount(10) > 1 and ccRS.Manual_AoE and SIR("Explosive Trap") then
		-- 	ccrCast("Explosive Trap")
		-- 	CastAtLocation(Target:GetLocation())
		-- 	return
		-- end
		if not ccrTargetHasMyDebuff("Serpent Sting") and SCA("Serpent Sting") and GetTime() > _G[UnitGUID("target").."_tSerpentSting"] and not ccrTargetHasDebuff(145065) and not ccrTargetHasDebuff(145171) then -- Serpent Sting
			ccrCastAttack("Serpent Sting")
			_G[UnitGUID("target").."_tSerpentSting"] = GetTime()+1.5
			return
		end

		if useCDS and SIR("Blood Fury") then ccrCast("Blood Fury") return end
		if ccrPlayerHasTalent("Dire Beast") and SIR("Dire Beast") then ccrCast("Dire Beast") return end
		if ccrPlayerHasTalent("Fervor") and SIR("Fervor") and ccrPlayerFocus() <= 65 then ccrCast("Fervor") return end
		if SIR("Bestial Wrath") and ccrPlayerFocus() > 60 and not ccrPHB("The Beast Within") then ccrCast("Bestial Wrath") return end

		if SCA("Multi-Shot") and (ccRS.Auto_AoE or ccRS.Manual_AoE) and (GTargetCount(8) > 5 and (GTargetCount(8) > 1 and not ccrUnitHasBuff("pet", "Beast Cleave"))) then ccrCastAttack("Multi-Shot") return end
		
		if SIR("Rapid Fire") and not ccrPHB("Rapid Fire") then ccrCast("Rapid Fire") return end

		if useCDS and SCA("Stampede") and ccrTargetIsBoss() and (ccrPHBS(146310, 10) or ccrPHB("Vicious") or ccrPHB("Dextrous")) then ccrCastAttack("Stampede") return end

		-- Stampede,if=trinket.stat.agility.up|target.time_to_die<=20|(trinket.stacking_stat.agility.stack>10&trinket.stat.agility.cooldown_remains<=3)

		-- Barrage,if=enabled&active_enemies>5
		-- if ccrPlayerHasTalent("Barrage") and SIR("Barrage") and ccrTargetCount

		if SCA("Kill Shot") then ccrCastAttack("Kill Shot") return end
		if SCA("Kill Command") and GPet(Target, 25) then ccrCastAttack("Kill Command") return end
		
		if ccrPlayerHasTalent("A Murder of Crows") and SCA("A Murder of Crows") and not ccrTargetHasMyDebuff("A Murder of Crows") and not ccrTargetHasDebuff(145065) and not ccrTargetHasDebuff(145171) then ccrCastAttack("A Murder of Crows") return end
		if ccrPlayerHasTalent("Glaive Toss") and SCA("Glaive Toss") then ccrCastAttack("Glaive Toss") return end
		if ccrPlayerHasTalent("Lynx Rush") and SIR("Lynx Rush") and GPet(Target, 10) then ccrCastAttack("Lynx Rush") return end
		if ccrPlayerHasTalent("Barrage") and SIR("Barrage") and GPet(Target, 40) then ccrCastAttack("Barrage") return end
		if ccrPlayerHasTalent("Powershot") and SCA("Powershot") then ccrCastAttack("Powershot") return end -- Powershot
		if SCA("Cobra Shot") and GTargetCount(8) > 5 then ccrCastAttack("Cobra Shot") return end
		if SCA("Arcane Shot") and (ccrPHB("Thrill of the Hunt") or ccrPHB("The Beast Within")) then ccrCastAttack("Arcane Shot") return end
		if SIR("Focus Fire") and ccrPHBS("Frenzy", 5) then ccrCast("Focus Fire") return end
		if SCA("Cobra Shot") and ccrTargetHasMyDebuff("Serpent Sting") and ccrTargetHasMyDebuffRemaining("Serpent Sting", 6) then ccrCastAttack("Cobra Shot") return end
		if SCA("Arcane Shot") and ccrPlayerFocus() > 60 then ccrCastAttack("Arcane Shot") return end
		if SCA("Cobra Shot") then ccrCastAttack("Cobra Shot") return end
	end
end

function HunterG1zStar3() -- survival

	if not ThrottleFrame then _ThrottleFrame() end

	-- if isAoE == nil then AoEToggle() end
	if ccrValidTarget() and ccrPIIC() then

		if ccRS.G1zStarInterrupt then InterruptTrainer() end
		
		if not _G[UnitGUID("target").."_tSerpentSting"] then _G[UnitGUID("target").."_tSerpentSting"] = 0 end

		if isStun and SCA("Intimidation") then
			ccrCastAttack("Intimidation")
			isStun = false
			PrintToChat("Turned off stun automatically")
		end
		if useCDS and SIR("Blood Fury") and ccrTargetIsBoss() then ccrCast("Blood Fury") end
		if GTargetCount(10) > 1 and (ccRS.Auto_AoE or ccRS.Manual_AoE) and not Target:IsMoving() and SIR("Explosive Trap") then
			ccrCast("Explosive Trap")
			CastAtLocation(Target:GetLocation())
			return
		end
		if ccrPlayerHasTalent("Fervor") and SIR("Fervor") and ccrPlayerFocus() <= 50 then
			ccrCast("Fervor")
			return
		end
		if SCA("A Murder of Crows") and not ccrTargetHasDebuff(145065) and not ccrTargetHasDebuff(145171) then
			ccrCastAttack("A Murder of Crows")
			return
		end
		if SCA("Lynx Rush") and not ccrTargetHasDebuff(145065) and not ccrTargetHasDebuff(145171) then
			ccrCastAttack("Lynx Rush")
			return
		end
		if ccrPHB("Lock and Load") and SCA("Explosive Shot") and not ccrTargetHasDebuff(145065) and not ccrTargetHasDebuff(145171) then
			ccrCastAttack("Explosive Shot")
			return
		end
		if SCA("Glaive Toss") then
			ccrCastAttack("Glaive Toss")
			return
		end
		if SCA("Powershot") then
			ccrCastAttack("Powershot")
			return
		end
		if SCA("Barrage") then
			ccrCastAttack("Barrage")
			return
		end
		if not ccrTargetHasMyDebuff("Serpent Sting") and SCA("Serpent Sting") and GetTime() > _G[UnitGUID("target").."_tSerpentSting"] and not ccrTargetHasDebuff(145065) and not ccrTargetHasDebuff(145171) then -- added nil check
			if GTargetCount(8) > 3 and (ccRS.Auto_AoE or ccRS.Manual_AoE) and SCA("Multi-Shot") then ccrCastAttack("Multi-Shot") return end
			ccrCastAttack("Serpent Sting")
			_G[UnitGUID("target").."_tSerpentSting"] = GetTime()+1.5 -- changed from 3 to 1.5
			return
		end
		if SCA("Explosive Shot") and not ccrTargetHasDebuff(145065) and not ccrTargetHasDebuff(145171) then
			ccrCastAttack("Explosive Shot")
			return
		end
		if SCA("Kill Shot") then
			ccrCastAttack("Kill Shot")
			return
		end
		if not ccrTargetHasMyDebuff("Black Arrow") and SCA("Black Arrow") and not ccrTargetHasDebuff(145065) and not ccrTargetHasDebuff(145171) then
			ccrCastAttack("Black Arrow")
			return
		end
		if GTargetCount(8) > 3 and SCA("Multi-Shot") and (ccRS.Auto_AoE or ccRS.Manual_AoE) and not ccrTargetHasDebuff(145065) and not ccrTargetHasDebuff(145171) then
			ccrCastAttack("Multi-Shot")
			return
		end
		if ccrPHB("Thrill of the Hunt") and (ccrTargetHasMyDebuffRemaining("Serpent Sting", 2) or not ccrTargetHasMyDebuff("Serpent Sting")) and SCA("Multi-Shot") and not ccrTargetHasDebuff(145065) and not ccrTargetHasDebuff(145171) then
			if GetTime() < _G[UnitGUID("target").."_tSerpentSting"] then return end
			ccrCastAttack("Multi-Shot")
			_G[Target.GUID.."_tSerpentSting"] = GetTime()+1.5 -- changed from 3 to 1.5
			return
		end
		if ccrPHB("Thrill of the Hunt") and SCA("Arcane Shot") then
			ccrCastAttack("Arcane Shot")
			return
		end
		if SIR("Rapid Fire") then
			ccrCast("Rapid Fire")
			return
		end
		if SIR("Dire Beast") then
			ccrCast("Dire Beast")
			return
		end
		if useCDS and SCA("Stampede") and ccrTargetIsBoss() and (ccrPHBS(146310, 10) or ccrPHB("Vicious") or ccrPHB("Dextrous")) then
			ccrCastAttack("Stampede")
			return
		end
		if ccrTargetHasMyDebuffRemaining("Serpent Sting", 6) and SCA("Cobra Shot") then
			ccrCastAttack("Cobra Shot")
			return
		end
		if ccrPlayerFocus() >= 67 and SCA("Arcane Shot") then
			ccrCastAttack("Arcane Shot")
			return
		end
		if SCA("Cobra Shot") then
			ccrCastAttack("Cobra Shot")
			return
		end
	end
end